package com.zy.mc_module.mvp.model;

import com.zy.mc_module.mvp.base.BaseModel;
import com.zy.mc_module.mvp.bean.BaseBean;
import com.zy.mc_module.utils.retrofit.RetrofitManager;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created on 2018/11/30
 * 获取验证码
 */
public class GetCodeModel implements BaseModel {
    public Observable<ResponseBody> getRegisterCode(String phone, String verityCode) {
        Map<String, Object> map = new HashMap<>();
        map.put("phone", phone);
        map.put("verifyCode", verityCode);
        return RetrofitManager.getInstance().getApi().getSmsCode(map);
    }
    public Observable<ResponseBody> getLoginCode(String phone, String verityCode) {
        Map<String, Object> map = new HashMap<>();
        map.put("phone", phone);
        map.put("verifyCode", verityCode);
        return RetrofitManager.getInstance().getApi().getLoginSmsCode(map);
    }
    public Observable<ResponseBody> getForgetSmsCode(String phone, String verityCode) {
        Map<String, Object> map = new HashMap<>();
        map.put("phone", phone);
        map.put("verifyCode", verityCode);
        return RetrofitManager.getInstance().getApi().getForgetSmsCode(map);
    }
    public Observable<BaseBean<String>> getCode(Object... objects) {
        Map<String, Object> map = new HashMap<>();
        map.put("source", "1");
        map.put("smsSendType", objects[0]);
        map.put("mobile", objects[1]);
        return RetrofitManager.getInstance().getApi().getCode(map);
    }
}
